﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RolePlayingGame
{
    public struct Coord
    {
        public int X { get; set; } //left to right axis
        public int Y { get; set; } //up-down axis

        public Coord(int x, int y) : this()
        {
            this.X = x;
            this.Y = y;
        }


        //MT: overloading "+" & "-" operators will make possible movement of objects by adding/subtracting coordinates to their current location
        public static Coord operator +(Coord currentLocation, Coord stepToNextLocation)
        {
            return new Coord(currentLocation.X + stepToNextLocation.X, currentLocation.Y + stepToNextLocation.Y);
        }

        public static Coord operator -(Coord currentLocation, Coord stepToNextLocation)
        {
            return new Coord(currentLocation.X - stepToNextLocation.X, currentLocation.Y - stepToNextLocation.Y);
        }

    }
}
